1. Field of the Invention
This invention relates to improved digital computers and, more particularly, to dynamically optimized instruction execution circuits for such digital computers.
2. Description of the Prior Art
Digital computers are machines which retrieve instructions or commands from a computer memory and execute each instruction by performing an indicated operation on one or more operands, also stored in the computer memory. There are three basic steps involved in the execution of each instruction. First, the instruction must be fetched from the computer memory. Second, this instruction must be decoded to determine what operation is to be performed. Finally, the instruction is executed. This process has become known as the "fetch-decode-execute" cycle.
There are three basic types of computer architectures which are classified as to the manner in which the instructions specify the operands to be operated upon. In so-called "register-to-register" architectures, operands are loaded into registers before performing these operations. A second type of architecture, called "storage-to-storage" architecture, specifies each of the operands by a memory address. Such architectures include instructions with one, two or three addresses. The instructions are executed by using the storage address to retrieve the operands and then by performing the indicated operation on those retrieved operands. A final address might be used to indicate the storage location in which the results are to be stored. Register-to-register and storage-to-storage architectures can be mixed with operands sometimes specified by a register and sometimes by an address.
The third type of architecture defines a class called "stack machines." In any machine with such an architecture, the operands are placed on an expression stack, and the instructions are ordered in so-called "reverse-polish" or "postfix" notation. A stack is nothing more than a storage mechanism which obeys a last-in, first-out storage and retrieval sequence.
Although each of the above three basic architectures has its own advantages and disadvantages, stack machines are generally considered to minimize the difficulty in generating code and are also better for evaluating complex expressions. On the other hand, so-called storage-to-storage and register-to-register machines have the advantage of minimizing the number of instruction executions required to complete a given task. As a result, stack machines are less efficient, typically requiring a much larger number of instructions, and hence more fetch-decode-execute cycles and memory references, to perform the same task than does a machine having a storage-to-storage architecture.
It has also been determined that a large percentage of program statements in most high-level languages are simple statements involving three storage locations. An operation is performed on the operands in two of the storage locations and the result assigned to the third storage location. It would thus appear that a storage-to-storage type of computer architecture would be the most efficient for executing such program statements. A discussion of this conclusion can be found in "The Case Against Stacked-Oriented Instruction Sets" by G. J. Myers in Computer Architecture News, 1977, pages 7 through 10.
It would be convenient to combine the ease of programming associated with stack oriented machines with the efficient operation of storage-to-storage machines.